package com.jzo2o.customer.controller.worker;

import com.jzo2o.customer.model.dto.request.BankAccountUpsertReqDTO;
import com.jzo2o.customer.model.dto.response.BankAccountResDTO;
import com.jzo2o.customer.service.IBankAccountService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 服务人员端 - 银行账户相关接口
 * @author: menghao
 * @version: 1.0
 * @Date: 2025/09/17 9:22
 * @Description:
 */
@RestController("workerBankAccountController")
@RequestMapping("/worker/bank-account")
@Api(tags = "服务人员端 - 银行账户相关接口")
public class BankAccountController {
    @Resource
    private IBankAccountService bankAccountService;

    /**
     * 新增或更新银行账户
     * @param dto
     */
    @PostMapping
    public void upSert(@RequestBody BankAccountUpsertReqDTO dto) {
        bankAccountService.upSert(dto);
    }

    @GetMapping("/currentUserBankAccount")
    public BankAccountResDTO queryCurrentUserBankAccount() {
        return bankAccountService.queryCurrentUserBankAccount();
    }
}
